package com.ly.lw.styledo.fragment;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RadioGroup;

import com.lidroid.xutils.BitmapUtils;
import com.lidroid.xutils.DbUtils;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.exception.DbException;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.ly.lw.styledo.BaseApp;
import com.ly.lw.styledo.R;
import com.ly.lw.styledo.adapter.BrandAllAdapter;
import com.ly.lw.styledo.adapter.MyLogoAdapter;
import com.ly.lw.styledo.bean.BrandLogo;
import com.ly.lw.styledo.bean.Logo;
import com.ly.lw.styledo.ui.MyScrollView;
import com.ly.lw.styledo.utils.FileUtils;
import com.ly.lw.styledo.utils.FragmentTableUtils;
import com.ly.lw.styledo.widget.ListViewForScrollView;

import java.util.ArrayList;
import java.util.List;


public class MyFragment extends Fragment {
    private MyScrollView mScrollView;
    private ImageView mImageView;
    private LinearLayout mFlowLayout;
    private LinearLayout scroll_lineView;


    private FragmentManager fragmentManager;
    @ViewInject(R.id.my_rgs)
    private RadioGroup rgs;
    ArrayList<Fragment>  fragments = new ArrayList<>();



    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        fragments.add(new MyGridFragment());
        fragments.add(new MyShopFragment());



    }



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_my, container, false);
        ViewUtils.inject(this, view);
        initView(view);
        new FragmentTableUtils(getChildFragmentManager(),fragments,R.id.my_list_view,rgs);

       // loadData();
        return view;
    }



    private void initView(View view) {
        //listViewForScrollView = (ListViewForScrollView) view.findViewById(R.id.my_list_view);
        mScrollView = (MyScrollView) view.findViewById(R.id.scroll_view);
        mImageView = (ImageView) view.findViewById(R.id.image_view);
        mFlowLayout = (LinearLayout) view.findViewById(R.id.flow_llay);
        scroll_lineView = (LinearLayout) view.findViewById(R.id.scroll_lineView);




        //监听浮动view的滚动状态
        //将 ImageView 设置View
        mScrollView.listenerFlowViewScrollState(mImageView, mFlowLayout);

    }











}
